﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="BGM_Project_Option_Old.aspx.cs" Inherits="KPIS.GERP.GBMS.APP_UI.Form.BGM_Project_Option_Old" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<%@ Register src="../Controls/Combo/SourceCombo.ascx" tagname="Source" tagprefix="uc5" %>
<%@ Register src="../Controls/Combo/ExpenseCombo.ascx" tagname="Expense" tagprefix="uc6" %>


<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <meta http-equiv="X-UA-Compatible" content="IE=9" />
    <title><asp:Literal runat="Server" id="litTitle"/></title>
</head>
<body>
    <form id="form1" runat="server">
        <link rel="StyleSheet" href="../../Styles/StyleSheet.css" type="text/css">
        
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>  
        
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" BackgroundPosition="None" > 
        </telerik:RadAjaxLoadingPanel>
        
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="btnSaveAddNewOpt">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="gridOption" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="cbNotFix">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="gridOption" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>    


        <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
            <script type="text/javascript">

                function isNumberKey(event) 
                {
                 var charCode = (event.which) ? event.which : event.keyCode
                 if(charCode > 31 && (charCode < 48 || charCode > 57)){
                     return false;
                  }
                 return true;
                }

                function onTextChange(sender) {
                    if (sender.get_value() == "") {
                        sender.set_text("");
                    }
                } 
                

                function GetRadWindow() {
                    var oWindow = null;
                    if (window.radWindow) oWindow = window.radWindow;
                    else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
                    return oWindow;
                }
                function returnToParent() {
                    var oWnd = GetRadWindow();
                    oWnd.close();
                    return false;
                }

                var sumInput = null;
                var tempValue = 0.0;

                function Load(sender, args) {
                    sumInput = sender;
                }
                function Blur(sender, args) {
                    sumInput.set_value(tempValue + sender.get_value());
                }
                function Focus(sender, args) {
                    tempValue = sumInput.get_value() - sender.get_value();
                }

                function confirmFn() {
                    if (confirm("Are you sure?")) {
                        return true;
                    }
                    else {
                        return false;
                    }

                }

            </script>
        </telerik:RadCodeBlock>
    <div class="bigModuleFull900">
        <div class="bigModuleBottom900">
            <div class="defaultFont">
            <asp:Panel ID="pnGridExpense" runat="server" Width="830px" Height="340px" ScrollBars="Auto">
                <table cellpadding="0" cellspacing="0" width="830px" class="defaultTable" >
                    <tr>
                        <td style="padding-left: 15px;">
                            <asp:Label ID="lbProjectID" runat="server" Visible="false"></asp:Label>
                            <asp:Label ID="lbOptionType" runat="server" Visible="false"></asp:Label>   
                            <telerik:RadGrid GroupingSettings-CaseSensitive="false" ID="gridOption" runat="server" AllowFilteringByColumn="false" 
                                Font-Names="Segoe UI" Font-Size="13px"
                                AllowMultiRowSelection="True" AutoGenerateColumns="False"
                                GridLines="None" MasterTableView-GridLines="None" Width="800px" Height="310px"
                                OnItemCommand="gridOption_ItemCommand" 
                                onitemdatabound="gridOption_ItemDataBound">
                                <mastertableview commanditemdisplay="None" datakeynames="value" grouploadmode="Client" width="100%" NoDetailRecordsText="... ไม่มีข้อมูล ..." GroupsDefaultExpanded="true"
                                    ShowFooter="true">
                                        <Columns>
                                            <telerik:GridBoundColumn FooterText="รวมทั้งหมด :" AutoPostBackOnFilter="true" 
                                                CurrentFilterFunction="Contains" DataField="text" 
                                                FilterControlWidth="100%" HeaderStyle-HorizontalAlign="Center" 
                                                HeaderText="" ShowFilterIcon="false" UniqueName="text">
                                                <HeaderStyle HorizontalAlign="Center" />
                                                <FooterStyle HorizontalAlign="Center" Font-Bold="true" />
                                            </telerik:GridBoundColumn>
                                            <telerik:GridTemplateColumn visible="false"
                                                HeaderStyle-HorizontalAlign="Center" HeaderText="lbOptSeq" ItemStyle-HorizontalAlign="Left"> 
                                                <ItemTemplate>
                                                    <asp:Label ID="lbOptSeq" runat="server" Text='<%# Eval("value") %>'></asp:Label>
                                                </ItemTemplate>
                                                <HeaderStyle HorizontalAlign="Center" />
                                            </telerik:GridTemplateColumn> 
                                            
                                            <telerik:GridTemplateColumn 
                                                UniqueName="Weight"
                                                ShowFilterIcon="false" 
                                                AllowFiltering="false"
                                                HeaderStyle-HorizontalAlign="Center" 
                                                HeaderText="น้ำหนัก" 
                                                ItemStyle-HorizontalAlign="Left">
                                                <HeaderStyle Width="16%" />
                                                <ItemStyle Width="16%" />
                                                <ItemTemplate>
                                                    <telerik:RadNumericTextBox ID="txtWeight" runat="server" Width="100px" Text='<%# Eval("weight") %>'>
                                                    <ClientEvents OnBlur="Blur" OnFocus="Focus" />
                                                    </telerik:RadNumericTextBox>
                                                </ItemTemplate>
                                                <FooterTemplate>
                                                    <telerik:RadNumericTextBox ID="txtFooterWeight" runat="server"
                                                        ForeColor="Blue" ReadOnly="true" Width="100px">
                                                        <ClientEvents OnLoad="Load" />
                                                    </telerik:RadNumericTextBox>
                                                </FooterTemplate>
                                                <HeaderStyle HorizontalAlign="Center" />
                                            </telerik:GridTemplateColumn> 
                                            
                                            <telerik:GridTemplateColumn visible="false"
                                                HeaderStyle-HorizontalAlign="Center" HeaderText="bgm_proj_opt_seq" ItemStyle-HorizontalAlign="Left"> 
                                                <ItemTemplate>
                                                    <asp:Label ID="lbProjOptSeq" runat="server" Text='<%# Eval("bgm_proj_opt_seq") %>'></asp:Label>
                                                </ItemTemplate>
                                                <HeaderStyle HorizontalAlign="Center" />
                                            </telerik:GridTemplateColumn> 
                                        </Columns>
                                       <groupbyexpressions>
                                            <telerik:GridGroupByExpression>
                                                <groupbyfields>
                                                    <telerik:GridGroupByField FieldName="bgm_option_code_1" HeaderText="" />
                                                </groupbyfields>
                                                <selectfields>
                                                    <telerik:GridGroupByField FieldName="bgm_option_name_1" HeaderText="&nbsp;" HeaderValueSeparator="" />
                                                </selectfields>
                                            </telerik:GridGroupByExpression>
                                        </groupbyexpressions>
                                    </mastertableview>
                                <clientsettings enablerowhoverstyle="true">
                                    <clientevents />
                                    <selecting allowrowselect="True" />
                                    <Scrolling AllowScroll="true" UseStaticHeaders="true" />
                                </clientsettings>
                            </telerik:RadGrid>
                        </td>
                    </tr>
                    <tr>
                        <td style="padding-left: 15px;" align="center">
                         <table width="800px">
                            <tr>
                                <td align="right">
                                    <asp:CheckBox ID="cbNotFix" runat="server" Text="ไม่ระบุ" 
                                        AutoPostBack="True" oncheckedchanged="cbNotFix_CheckedChanged" Visible="False" />
                                </td>
                            </tr>
                         </table>
                        </td>
                    </tr>
                    <%--<tr>
                        <td>
                            <br />
                            <table width="800px">
                                <tr>
                                    <td width="680px" align="right" style="font-weight: bold">
                                        รวมน้ำหนัก :
                                    </td>
                                    <td align="right">
                                        <asp:Label ID="lbSumWeight" runat="server" ForeColor="Blue" 
                                            Font-Bold="True" Text="0"></asp:Label>
                                    </td>
                                    <td width="20px">
                                        %
                                    </td>
                                </tr>
                            </table>
                         </td>
                    </tr>--%>
                </table>
            </asp:Panel>
            <br />
                <table width="800px">
                    <tr valign="top">
                        <td align="center" style="padding-top: 15px; border-top-style: double; border-top-width: 1px; border-top-color: #000000;">
                            <asp:Button ID="btnSaveAddNewOpt" runat="server" Text="บันทึกข้อมูล" OnClick="btnSaveAddNewOpt_Click" />
                        </td>
                    </tr>
                </table>            
            </div>
        </div>
    </div>
    </form>
</body>
</html>
